import pytest
import requests
from confing import  readconf

wz=readconf.read()

# @pytest.fixture(scope='session')
def ctoken():
    d={'username':'admin','password':123456}
    h={'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8'}
    t=wz.get_crm('csj')
    u=wz.get_crm('cwz')
    c=requests.post(u+'/login',data=d,headers=h,timeout=int(t))
    tk=c.json()
    adtoken=tk['Admin-Token']
    # return token
    print(adtoken)

ctoken()
